var constant = require('../config/constant.config');

merchantPassedController.$inject = ['$location','merchantService','$scope']
function merchantPassedController($location,merchantService,$scope) {
    $scope.merchants = [];
    $scope.detailMerchant = {};
    $scope.imgUrl = constant.IMG_CONTEXT;
    //init data
    merchantService.findMerchantByStatus(2)
        .then(function(res){
            var rs = res.data;
            if(!rs.result){
                alert('find merchant fail');
            }else {
                $scope.merchants = rs.data;
            }
        });

    //view the merhcant details
    $scope.viewDetail = function(mer){
        $scope.detailMerchant = mer;
    }

}

module.exports = merchantPassedController;